package com.ushine.web.template.complex.controller;

import com.ushine.web.base.model.relation.RoleAndFunctionPermissionDO;
import com.ushine.web.component.http.HttpResponseVO;
import com.ushine.web.log.annotation.SystemControllerLog;
import com.ushine.web.log.constant.LogConstant;
import com.ushine.web.template.complex.facade.IDemoFacade;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: yls
 * @Date 2022/2/7 16:19
 * @Description: 包装层service测试
 * @Version 1.0
 **/
@RestController
@RequestMapping("component/facade")
@Api(tags = "组件模块-包装层service测试")
public class FacadeDemoController {

    @Resource
    private IDemoFacade demoFacade;

    @SystemControllerLog(operation = LogConstant.READ)
    @ApiOperation(value = "根据id查询")
    @GetMapping("get/{username}")
    public HttpResponseVO<List<RoleAndFunctionPermissionDO>> getDemoById(@RequestParam @PathVariable String username) {
        List<RoleAndFunctionPermissionDO> roleAndFunctionPermissions = demoFacade.listPermissions(username);
        return new HttpResponseVO<List<RoleAndFunctionPermissionDO>>().ok("", roleAndFunctionPermissions);
    }


}
